package com.example.microinvestuser.dao;
import com.example.microinvestcommon.entity.Users;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserMapper {

    //用户注册
    void registerUsers(Users users);

    //通过用户名称返回userId
    Long getUserIdFromUserName(String userName);

    //用户注册stockSummary表
    void registerUserStockSummary(long userId);

    //用户名或邮箱是否存在
    Boolean existsByUsernameOrEmail(String userName,String email);

    //比对用户名对应的密码哈希值是否正确
    Boolean comparePassword(String userName, String encryptedPassword);

    //获取用户数据
    Users usersInfo(String userName,String email);

    //修改密码
    void updateWithOldPwd(String newPassword);

    //用户注销
    void deleteUserOrder(Long userId);
    void  deleteUserBuyStock(Long userId);
    void deleteUserSellStock(Long userId);
    void deleteUserFavorites(Long userId);
    void deleteUserStockSummary(Long userId);
    void deleteUser(Long userId);
}
